package com.wondertek.service.dto.sys.req;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.io.Serializable;


@Data
public class SysEmailConfigAddReq implements Serializable {

    /**
     * 发件人
     */
    @Schema(name = "fromUser",description = "发件人")
    @NotBlank(message = "email.fromUser.not.null")
    @Length(max = 30, message = "email.fromUser.length")
    @Pattern(regexp = "^(.+)@(.+)$", message = "email.format.error")
    private String fromUser;

    /**
     * 邮件服务器SMTP地址
     */
    @Schema(name = "host",description = "邮件服务器SMTP地址")
    @NotBlank(message = "email.host.not.null")
    @Length(max = 30, message = "email.host.length")
    private String host;

    /**
     * 密码
     */
    @Schema(name = "pass",description = "密码")
    @NotBlank(message = "email.pass.not.null")
    @Length(max = 80, message = "email.pass.length")
    private String pass;

    /**
     * 端口
     */
    @Schema(name = "port",description = "端口")
    @NotNull(message = "email.port.not.null")
    private Integer port;

    /**
     * 发件者用户名
     */
    @Schema(name = "user",description = "发件人用户名")
    @NotBlank(message = "email.user.not.null")
    @Length(max = 30, message = "email.user.length")
    private String user;
}
